const http = require('../utils/http.js');

// 获取用户信息
const getUser = () => {
    return http.request('GET', '/User/current');
    // return http.request('GET', 'user/login');
}

// 解密手机号
const decodePhone = (params) => {
    return http.request('GET', `/WeiXin/WxOpen/DecryptPhoneNumber?sessionId=${params.sessionId}&encryptedData=${params.encryptedData}&iv=${params.iv}`)
}

// 更新手机号
const updatePhone = (params) => {
    return http.request('GET', `/WeiXin/WxOpen/UpdatePhone?sessionId=${params.sessionId}&tell=${params.tell}`)
}
// 视频
const pay_video = (params) => {
    return http.request('GET', `/video/list`,{},true)
}
// 优惠卷列表
const coupon_couponlist = (params) => {
    return http.request('GET', `/Coupon/0/list?type=${params.type}&pagesize=${params.pagesize}&page=${params.page}`,{},true)
}
const coupon_receive = (params) => {
    return http.request('GET', `/coupon/receive?id=${params.id}`,{},true)
}
module.exports = {
    getUser,
    pay_video,
    updatePhone,
    decodePhone,
    coupon_couponlist,
    coupon_receive
}